package Test;

import java.util.List;
import java.io.*;

import com.mongodb.BasicDBObject;
import com.mongodb.DBObject;

import hpu.bitenergy.Factory.Factory;
import hpu.bitenergy.Factory.IntelligenceFactory;
import hpu.bitenergy.IFactory.IFactory;
import hpu.bitenergy.List.GetList;
import hpu.bitenergy.util.QueryHelper;
import hpu.bitenergy.util.StringHelper;

public class test {
//添加测试
	public static void main(String[] args) {
		//测试情报
//		IFactory fa=Factory.GetIFactory("I");
//		GetList li=fa.GetListInstance();
//		List<DBObject> list=li.getQueryList(QueryHelper.expert_name("周仕学"));
		//测试专家
//		String  name="郑仕远";
//		System.out.println(name);
//		IFactory fac=Factory.GetIFactory("hpu.bitenergy.Factory.ExpertsFactory");
//		GetList li=fac.GetListInstance();
//		List<DBObject> list=li.getQueryList(QueryHelper.expert_name(StringHelper.AddTwoKong(name)));
//		System.out.println(list.toString());
//		//测试文献
//		IFactory fc=Factory.GetIFactory("hpu.bitenergy.Factory.LiteratureFactory");
//		GetList li=fc.GetListInstance();
//		List<DBObject> list =li.getQueryList(QueryHelper.expert_name(StringHelper.AddOneKong("郑仕远")));
//		System.out.println(list.toString());
		//测试专利
//		IFactory fa=Factory.GetIFactory("P");
//		GetList li=fa.GetListInstance();
//		List<DBObject> list=li.getQueryList(QueryHelper.expert_name("郑仕远"));
//		System.out.println(list.toString());
		
//		//通过专家名查合作者   关联图
//		IFactory fa=Factory.GetIFactory("L");		
//		GetList li=fa.GetListInstance();
//		List<DBObject> list=li.getQueryList(QueryHelper.expert_name(" 张晓"),QueryHelper.author_cn(true));	
//		String name=StringHelper.GetAuther_name(list,"张晓");		
//		System.out.println(name+"ok");
		
		//专家查找合作团队    合作团队
		IFactory fa=Factory.GetIFactory("L");
		GetList li=fa.GetListInstance();
		List<DBObject> list=li.getQueryList(QueryHelper.expert_name(" 姚可夫"),QueryHelper.author_cn(true));

		
		for(int i=0;i<list.size();i++)		
		System.out.println("合作团队有："+list.get(i).get("author_cn").toString());
		
		
		//统计专家研究方向
//		IFactory fad=Factory.GetIFactory("L");
//		GetList li=fad.GetListInstance();
//		List<DBObject> list=li.getQueryList(QueryHelper.expert_name(" 熊守美"),QueryHelper.getKey(true));
//		String name=StringHelper.GetKey(list);
////插入研究方向
//		System.out.println(name);
//		System.out.println("ok");
	
	//查询专利最多前6个专家
	//IFactory fa=Factory.GetIFactory("E");
//	IFactory fa=Factory.GetIFactory("hpu.bitenergy.Factory.ExpertsFactory");
//	GetList li=fa.GetListInstance();
//	List<DBObject> list=li.getQueryListLimit(QueryHelper.gettuijianE());	
//	System.out.println(list.toString());
//	System.out.println("ok");
	}
}
